<?php 

	class Person {
		public $name = "";
		public $age  = 18;
		public $sex  = "男";
		public $marr = array(
			"aaa",
			"bbb",
			"ccc",
			"ddd"
		);

		public function __construct($name, $age, $sex) {
			$this->name = $name;
			$this->age  = $age;
			$this->sex  = $sex;
		}

		public function say() {
			echo "我叫".$this->name;
		}

		public function __toString() {
			echo "Hello!!!";
		}

		public function __call($method, $args) {
			if (in_array($method, $this->marr)) {
				echo $args[0]."<br>";
			}else{
				echo "你调用的方法{$method}()不存在！<br>";
			}

			/*echo "对不起！你调用的方法{$method}(),参数为";
			print_r($args);
			echo "不存在！<br>";*/
		}
	}


	//从文件中读出字符串
	$str = file_get_contents("22-objstr.txt");

	//返串行化
	$p = unserialize($str);

	echo $p->say();





 ?>